﻿using System.Linq.Expressions;

namespace PoemGame.Domain.GameAggregate
{
    public interface IGameRepository
    {
        /// <summary>
        /// 获取游戏
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<Game?> GetAsync(Guid id);
        /// <summary>
        /// 添加游戏
        /// </summary>
        /// <param name="game"></param>
        /// <returns></returns>
        Task<Guid> AddAsync(Game game);
        /// <summary>
        /// 更新游戏
        /// </summary>
        /// <param name="game"></param>
        /// <returns></returns>
        Task UpdateAsync(Game game);
        /// <summary>
        /// 删除游戏
        /// </summary>
        /// <param name="game"></param>
        /// <returns></returns>
        Task RemoveAsync(Game game);
        /// <summary>
        /// 获取所有游戏
        /// </summary>
        /// <returns></returns>
        Task<IEnumerable<Game>> GetAllAsync();
        /// <summary>
        /// 根据条件获取游戏
        /// </summary>
        /// <param name="predicate"></param>
        /// <returns></returns>
        Task<IEnumerable<Game>> GetByConditionAsync(Expression<Func<Game, bool>> predicate);
    }
}
